package com.dream.testtubebaby.adapter;

import java.util.ArrayList;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Log;
import android.view.ViewGroup;

public class CommonTabAdapter extends FragmentPagerAdapter {

	private ArrayList<Fragment> fragmentsList;

    public CommonTabAdapter(FragmentManager fm) {
        super(fm);
    }
    
    public CommonTabAdapter(FragmentManager fm, ArrayList<Fragment> fragments) {
        super(fm);
        this.fragmentsList = fragments;
    }

    @Override
    public int getCount() {
    	Log.d("BbsFragment", "BbsTabAdapter - getCount");
        return fragmentsList.size();
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
    	Log.d("BbsFragment", "BbsTabAdapter - instantiateItem " + position);
    	return super.instantiateItem(container, position);
    }
    
    @Override
    public Fragment getItem(int arg0) {
    	Log.d("BbsFragment", "BbsTabAdapter - getItem");
        return fragmentsList.get(arg0);
    }
    
    @Override
    public int getItemPosition(Object object) {
    	Log.d("BbsFragment", "BbsTabAdapter - getItemPosition");
        return super.getItemPosition(object);
    }

}
